package com.example.kotlinstudy

// 导入
import android.os.Bundle
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat

// 继承
class SecondActivity : AppCompatActivity() {
    // 重写
    override fun onCreate(savedInstanceState: Bundle?) {
        // 调用父类的方法
        super.onCreate(savedInstanceState)
        // enableEdgeToEdge
        enableEdgeToEdge()
        //  加载布局文件
        setContentView(R.layout.activity_second)

        println(R.string.joke)

        ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main)) { v, insets ->
            val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
            v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
            insets
        }
    }
}